<template>
    <div>
        <input type="text" placeholder="请输入用户名" v-model="username">
        <input type="text" placeholder="请输入密码" v-model="password">
        <button @click="Login">登录</button>
    </div>
</template>

<script lang="ts" setup>
import { ref, type Ref } from 'vue'
import { useRouter, useRoute } from 'vue-router'
// @ts-ignore
import { useUserStore } from '@/stores/UserStore'
const useUser = useUserStore()

const router = useRouter()
const route = useRoute()

const username = ref('')
const password= ref('')

const Login = () => {
    const userInfo = {
        username: username.value,
        password: password.value
    };
    useUser.setUserIdAfterLogin(userInfo);
    router.push(`/my/session`)
}

</script>

<style scoped></style>